package com.shawn.model.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.shawn.model.entity.Options;
import com.shawn.model.entity.SoulQuestion;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author shawn
 * @date 2022年 11月 19日 17:31
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SoulQuestionVo implements Serializable {
    private String id;
    private String question;
    private List<OptionsVo> options;

    public static SoulQuestionVo init(SoulQuestion question,List<OptionsVo> optionsVos){
        SoulQuestionVo vo = new SoulQuestionVo();
        vo.setId(question.getId().toString());
        vo.setQuestion(question.getQuestion());
        vo.setOptions(optionsVos);
        return vo;
    }
}
